#ifndef ESCAL_GUI_H
#define ESCAL_GUI_H

#include "ui_escal_gui.h"
#include "url_dialog.h"
#include "folder_list_model.h"
#include "task_model.h"
#include "task.h"
#include <QtGui>

/*
 * The main window of Escal
*/
class TaskViewDelegate;

class EscalGui:public QMainWindow, public Ui::EscalGui
{
	Q_OBJECT
public:
	EscalGui(QWidget* parent=0);
	~EscalGui();
public slots:
	void 	close();
	void	quit();
	void 	about();
	void 	aboutQt();
	/*
	 * get the input from user or clipboard (no done)
	 * and create a new task .
	 */
	void newTask();
	/*
	 * get the selections from unDoneTaskView
	 * and start the corresponding tasks
	 */
	void startSelected();
	/*
	 * get the selections from unDoneTaskView
	 * and pause the corresponding tasks
	 */
	void pauseSelected();
	/*
	 * get the selections from unDoneTaskView
	 * and stop the corresponding tasks
	 */
	void stopSelected();
	void increaseSelected();
	void cutDownSelected();
	/*
	 * get the selections from unDoneTaskView
	 * and cancel the corresponding tasks
	 */
	void cancelSelected();
	/*
	 * show the preference window
	 */
	void preference();
private:
	/*
	 * connect the actions' singal with the slots 
	 */
	UndoneTaskViewDelegate *undoneTaskViewDelegate;
	UndoneTaskModel *undoneTaskModel;
	DoneTaskModel *doneTaskModel;
	FolderListModel *folderListModel;
	QDirModel *dirModel;
	UrlDialog *urlDialog;
public slots:
	void taskCompleted(BaseTask *task);
	void taskDeleted(BaseTask *task);
	void undoneTaskClicked(const QModelIndex & index);
	void doneTaskClicked(const QModelIndex & index);
	void folderClicked(const QModelIndex & index);

};


#endif /* ESCAL_GUI_H */
